Skip to content

fix(engine): use correct error codes for invalid payload attributes#1383

Closed
mattsse wants to merge 1 commit into
ethereum:masterfrom
mattsse:fix-withdrawals-error-codes
Closed

fix(engine): use correct error codes for invalid payload attributes#1383
mattsse wants to merge 1 commit into
ethereum:masterfrom
mattsse:fix-withdrawals-error-codes

Conversation

@mattsse
Copy link
Copy Markdown
Contributor

@mattsse mattsse commented Jan 24, 2026

Per the Engine API spec, error code -38003 (Invalid payload attributes) should be returned when payload attributes are invalid/inconsistent, not -32602 (Invalid params).

This fixes withdrawals tests that incorrectly expected -32602 for:

  • Pre-Shanghai ForkchoiceUpdatedV2 with non-null withdrawals
  • Pre-Shanghai NewPayloadV2 with withdrawals
  • Post-Shanghai FCU with null withdrawals (PayloadAttributesV1)
  • Post-Shanghai NewPayloadV2 with null withdrawals (ExecutionPayloadV1)

Spec reference: https://github.com/ethereum/execution-apis/blob/11517b401d84aee48e7f36ab366034e642a101c0/src/engine/common.md?plain=1#L99

Code Message
-38003 Invalid payload attributes

@mattsse mattsse force-pushed the fix-withdrawals-error-codes branch 6 times, most recently from bbc76f9 to 3d3e507 Compare January 24, 2026 12:37
Per the Engine API spec, error code -38003 (Invalid payload attributes) should
be returned when payload attributes are invalid/inconsistent, not -32602
(Invalid params).

This fixes withdrawals tests that incorrectly expected -32602 for:
- Pre-Shanghai ForkchoiceUpdatedV2 with non-null withdrawals
- Pre-Shanghai NewPayloadV2 with withdrawals
- Post-Shanghai FCU with null withdrawals (PayloadAttributesV1)
- Post-Shanghai NewPayloadV2 with null withdrawals (ExecutionPayloadV1)

Spec reference: https://github.com/ethereum/execution-apis/blob/main/src/engine/common.md#errors
@mattsse mattsse force-pushed the fix-withdrawals-error-codes branch from 3d3e507 to 80a8438 Compare January 24, 2026 12:37
@fjl
Copy link
Copy Markdown
Collaborator

fjl commented Mar 9, 2026

Some of these cases have now been fixed in #1398

@mattsse mattsse closed this May 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants